<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>变量类型</title>
  </head>
  <body>
    <script>
      // Number

      let a = 3;
      let b = 9;

      let c = b / a;

      //整型,浮点,NaN
      console.log(c);

      //String

      let name = "sss";
      //字符串直接使用+

      //占位符的形式${变量名}做字符串拼接(需要使用反引号)
      console.log(`my name is ${name} nice to meet you`);

      // boolean

      let boo = true;
      let boo1 = 1 == 0;

      //object
      //类似json的数据,键值对的形式书写{key:value,key:value}
      let stu = {
        stuName: "Alice",
        age: 18,
        id: 91872391739819238213,
      };

      const obj1 = stu;
      obj1 = [1, 1, 3];
      let arr = ["aaa", "bbbb"];
      //解构
      let { stuName, ...elseObj } = stu;
      let [a1, b1] = arr;

      console.log("剩余的值是", elseObj);
      console.log(" shuzu解构的值是:" + a1);

      //undefined 代表着变量未初始化
      let un;

      //null 指针为空

      let nu = null;

      console.log(typeof nu);

      console.log(11111);

      // 自动转换
      let num3 = 19;
      let s3 = "a";

      let num4 = +s3;

      console.log(num4);
    </script>
  </body>
</html>
